package meituan;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;

/**
 * 消费者类
 */
public class Customers {

    // zookerrper的ip和端口
    private String connectString = "";

    private int timeOut = 60*1000;

    private ZooKeeper zooKeeper;

    // 连接zookeeper
    private void connect() throws Exception{
        zooKeeper = new ZooKeeper(connectString, timeOut, new Watcher() {
            public void process(WatchedEvent watchedEvent) {

            }
        });
    }


    public static void main(String[] args) throws Exception {
        Customers client = new Customers();
        // 1.获取zookeepr的连接
        client.connect();
        // 2.获取meituan下的所有子节点
        client.getShopList();
        // 3.业务逻辑处理
        client.business();

    }

    private void business() {

    }

    private void getShopList() {

    }


}
